package com.brewster.config.model;

import com.jfinal.plugin.activerecord.Model;

/**
 * 本 demo 仅表达最为粗浅的 jfinal 用法，更为有价值的实用的企业级用法 详见 JFinal 俱乐部:
 * http://jfinal.com/club
 * 
 * Blog model. 数据库字段名建议使用驼峰命名规则，便于与 java 代码保持一致，如字段名： userId
 */
@SuppressWarnings("serial")
public class Role extends Model<Role> {
	public static final Role dao = new Role().dao();

	public Role findUserRole(String loginName) {
		return Role.dao.findFirst(
				"select * from da_role t inner join da_user_role t1 on  t.role_id  = t1.role_id  inner jion da_account  t2 on t1.user_id = t2.id and t.del_flag =? ",
				0);
	}
}
